home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / irsim-ca.2 / irsim-ca / irsim-cap-9.2 / src / ana11 / icon.c < prev    next >
C/C++ Source or Header  |  1993-01-15  |  2KB  |  55 lines

  1. /*
  2.  *     ********************************************************************* 
  3.  *     * Copyright (C) 1988, 1990 Stanford University.                     * 
  4.  *     * Permission to use, copy, modify, and distribute this              * 
  5.  *     * software and its documentation for any purpose and without        * 
  6.  *     * fee is hereby granted, provided that the above copyright          * 
  7.  *     * notice appear in all copies.  Stanford University                 * 
  8.  *     * makes no representations about the suitability of this            * 
  9.  *     * software for any purpose.  It is provided "as is" without         * 
  10.  *     * express or implied warranty.  Export of this software outside     * 
  11.  *     * of the United States of America may require an export license.    * 
  12.  *     *********************************************************************
  13.  */
  14.  
  15. #include "ana.h"
  16. #include "graphics.h"
  17. #include <X11/Xutil.h>
  18. #include "ana_glob.h"
  19.  
  20. #include "Bitmaps/opus"
  21.  
  22.  
  23. public Pixmap InitIconBitmap()
  24.   {
  25.     return( XCreateBitmapFromData( display, DefaultRootWindow( display ),
  26.       opus_bits, opus_width, opus_height ) );
  27.   }
  28.  
  29.  
  30. public void RedrawIcon( exv )
  31.   XEvent  *exv;
  32.   {
  33.     XCopyPlane( display, pix.icon, iconW, gcs.black, 0, 0, opus_width,
  34.      opus_height, 0, 0, 1 );
  35.   }
  36.  
  37.  
  38. public Window CreateIconWindow( x, y )
  39.   Coord  x, y;
  40.   {
  41.     Window      icw;
  42.  
  43.     icw = XCreateWindow( display, RootWindowOfScreen( screen ), x, y,
  44.      opus_width, opus_height, 1, DefaultDepthOfScreen( screen ), InputOutput,
  45.      (Visual *) CopyFromParent, 0L, (XSetWindowAttributes *) NULL );
  46.  
  47.     XSetWindowBackground( display, icw, colors.white );
  48.     XSetWindowBorder( display, icw, colors.black );
  49.     
  50.     XSelectInput( display, icw, ExposureMask );
  51.  
  52.     return( icw );
  53.   }
  54.  
  55.